﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Jzy.BLL.Project;
using Jzy.Model.Project;
using Jzy.Core.Common.Web;
using Frame.Lib.Utilities;
using Frame.Lib.Core.Dict;
using Frame.Lib.Enums;

public partial class Project_Detail : PageDetail
{
    private string PrjID
    {
        get
        {
            return StrUtil.DecryptUrl(Request["PrjID"]);
        }
    }
    private ProjectBO _prj = new ProjectBO();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DispInfo();
        }
    }

    private void DispInfo()
    {
        ProjectInfo info = _prj.GetInfo(PrjID);
        EntityUtil.SetControl(pnlMain, info);

        StartTime.Text = info.StartTime.ToString("yyyy-MM-dd");
        EndTime.Text = info.EndTime.ToString("yyyy-MM-dd");

        TypeName.Text = (new DictBO()).GetName(DictItem.项目类型,info.TypeCode);
        Importance.Text = ((PrjImportance)info.Importance).ToString();
        Status.Text = ((PrjStatus)info.Status).ToString();

        PrjTaskBO task = new PrjTaskBO(int.Parse(PrjID));
        int rootID = (int)task.GetRootID();
        PrjTaskInfo taskInfo = task.GetInfo(rootID);

        TimeLimit.Text = taskInfo.TimeLimit.ToString();
        Workload.Text = taskInfo.Workload.ToString();

    }
}
